package demo.miner.tools;

public class Range {

	private int value;
	private int min;
	private int max;
	
	public Range(int initialValue, int min, int max) {
		this.value = initialValue;
		this.min = min;
		this.max = max;
	}
	
	public void set(int initialValue, int min, int max) {
		this.value = initialValue;
		this.min = min;
		this.max = max;
	}
	
	public void up() {
		value = (value + 1 > max) ? min : value + 1;
	}
	
	public void down() {
		value = (value - 1 < min) ? max : value - 1;
	}
	
	public int getValue() {
		return value;
	}
	
}
